<template>
    <div>
      <common-card title="今日交易用户数" :value="userToday">
        <template>
<!--          <div id="today-user-chart" :style="{ width: '100%', height: '100%' }">-->
<!--          </div>-->
          <vue-echarts :options="getOptions()"></vue-echarts>
        </template>
        <template v-slot:footer >
          <div>
            <span>退货率 </span>
            <span class="emphasis">{{returnRate}}</span>
          </div>
        </template>
      </common-card>
    </div>
</template>

<script>
  import CommonCardMixin from '../../utils/CommonCardMixin'
  import CommonDataMixin from '../../utils/CommonDataMixin'
export default {
  name: 'TodayUsers',
  mixins: [CommonCardMixin, CommonDataMixin],
  methods: {
    getOptions () {
      return {
        color: ['#3398DB'],
        series: [{
          type: 'bar',
          data: this.userFullYear,
          barWidth: '60%'
        }],
        xAxis: {
          type: 'category',
          data: this.userFullYearAxis,
          show: false
          // boundaryGap: false
        },
        yAxis: {
          show: false
        },
        grid: {
          top: 0,
          bottom: 0,
          left: 0,
          right: 0
        }
      }
    }
  }
  // mounted () {
  //   const chartDom = document.getElementById('today-user-chart')
  //   // console.log(this.$echarts)
  //   const chart = this.$echarts.init(chartDom)
  //   chart.setOption({
  //     color: ['#3398DB'],
  //     series: [{
  //       type: 'bar',
  //       data: [410, 190, 220, 334, 390, 220, 570, 82, 340, 200, 134, 290, 310, 150],
  //       barWidth: '60%'
  //     }],
  //     xAxis: {
  //       type: 'category',
  //       data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00'],
  //       show: false
  //       // boundaryGap: false
  //     },
  //     yAxis: {
  //       show: false
  //     },
  //     grid: {
  //       top: 0,
  //       bottom: 0,
  //       left: 0,
  //       right: 0
  //     }
  //   })
  // }
}
</script>

<style scoped>

</style>
